<%@page pageEncoding="UTF-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
		<title>用户组信息修改</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
<base target="_self"/>
	</head>
<%
 response.setHeader("Pragma", "No-cache");
 response.setHeader("Cache-Control", "no-cache");
 response.setDateHeader("Expires", 0);
%>
<% if(request.getAttribute("result")!=null && request.getAttribute("result").toString().equals("OK")) {%>
<script language="javascript">
//向父窗口返回的值
window.returnValue = "这是子窗口返回来的值,需要刷新父窗口";
window.close();
</script>
<% } %>
<jsp:include page="../common/init.jsp"></jsp:include>
<script type="text/javascript">
//验证用户组名称是否重复
function checkYhzm(yhzm)
{
	var txt = "";
	var action=encodeURI("../servlet/CheckBmxx?validateFlag=yhz&yhzm="+yhzm+"&yhzbh=${appsysYhz.yhzbh}");
	var req = initRequest();
	req.open("post",action,false);
	req.onreadystatechange = function () {
	try {
		if (req.readyState != 4) {
			return;
		}
		if (req.status != 200) {alert("req.status = "+req.status);
			return;
		}
		txt = req.responseText;
	}
	catch (err) {
		//alert(errorMsg);
	}
	};
	req.send(null);
	return txt;
}
//用户组名验证
function validateYhzm(ajaxFlag){
	var checkId="appsysYhz.yhzm";
	var checkValue=document.getElementById("appsysYhz.yhzm").value;
	var errorDivId="yhzmDiv";
	var errorImgId="yhzmImg";
	if(checkNullValue(checkValue)){
		showMenuDelegate(checkId,errorDivId,errorImgId,"用户组名不能为空!");
		return false;
	}
	else if (checkValue.length>30)
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"用户组名长度不能超过30个字!");
		return false;
	}
	else if (ajaxFlag=='b')
	{
		var flag=checkYhzm(checkValue); 
		if(flag=='yes')
		{
			showMenuDelegate(checkId,errorDivId,errorImgId,"该用户组名称已被用,请重新填写!");
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
		hiddenErrorImg(errorImgId);
		return true;
	}
}
//功能描述长度
function validateYhzms()
{
	var checkId="appsysYhz.yhzms";
	var checkValue=document.getElementById("appsysYhz.yhzms").value;
	var errorDivId="yhzmsDiv";
	var errorImgId="yhzmsImg";
	if(checkValue.length>100)
	{
		showMenuDelegate(checkId,errorDivId,errorImgId,"功能描述不能超过100字!");
		return false;
	}
	else
	{
		hiddenErrorImg(errorImgId);
		return true;
	}
}
//提交;
function doSubmit()
{
	if(validateYhzm('b')&&validateYhzms())
	{
		document.forms[0].action="reworkYhz.do";
		document.forms[0].submit();
	}
	else
	{
		return false;
	}
}
//页面关闭
function winClose()
{
	window.returnValue = "ok";
	window.close();
}
//表单reset
function formReset()
{
	document.forms[0].reset();
}
//生成功能按钮	
mpmenu1=new mMenu('','winClose()','script','<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_44.gif','62','24','0','100','2');
mpmenu2=new mMenu('','#','self','<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_38.gif','62','24','0','20','0');
mpmenu3=new mMenu('','#','self','<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_42.gif','62','24','0','20','0');
</script>
	<body>
<s:form action="">
<table cellspacing="0" cellpadding="0" class="main_tab1">
    <tr>
        <td rowspan="4" class="main_tab1_td8">&nbsp;</td>
        <td class="main_tab1_td1"><img src="<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_28.gif" alt="left" /></td>
        <td class="main_tab1_td2">
		<div id="location">用户组信息添加</div>
		<div id="funbut">
			<SCRIPT>document.write(mwritetodocument());</SCRIPT>
		</div>
		</td>
        <td class="main_tab1_td1"><img src="<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_32.gif" alt="right" /></td>
    </tr>
    <tr>
       <td colspan="3" class="main_tab1_td3">
		<div id="mainbg">
		<div class="jiange10"></div>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="main_tab3">
				<tr valign="bottom" align="center" height="30">
				<th align="right">
						<s:hidden name="appsysYhz.yhzbh"></s:hidden>
						<s:hidden name="appsysYhz.scbz"></s:hidden>
						<s:hidden name="appsysYhz.cjr"></s:hidden>
						<s:hidden name="appsysYhz.cjrq"></s:hidden>
						<s:hidden name="appsysYhz.xtbm"></s:hidden>
					
						用户组名：
					</th>
					<td  align="left" valign="bottom" >
					<s:textfield name="appsysYhz.yhzm" id="appsysYhz.yhzm" size="20" maxLength="30"
						theme="simple" onclick="javascript: mouseClick('yhzmDiv')" 
								onfocus="this.style.borderColor='#68A6F5'" onblur="validateYhzm('a');" cssClass="inp_02">
					</s:textfield>
						 &nbsp;
				<img src="" id="yhzmImg" style="display:none;"/>
				<div id="yhzmDiv" style="background:#008080;display:none;cursor:default"/>
									&nbsp;
								<font color="#ff0000">*</font>
								<s:hidden name="appsysYhz.yhzlx" value="0"></s:hidden>
					</td>
					</tr>
				<tr valign="bottom" height="30">
					<th valign="middle" align="right">
						功能描述：
					</th>
					<td colspan="3" align="left" valign="bottom">
						<s:textarea id="appsysYhz.yhzms" name="appsysYhz.yhzms" cols="35" rows="6"
							theme="simple" onclick="javascript: mouseClick('yhzmsDiv')" 
								onfocus="this.style.borderColor='#68A6F5'" onblur="validateYhzms();" >
					</s:textarea>
						 &nbsp;
				<img src="" id="yhzmsImg" style="display:none;"/>
				<div id="yhzmsDiv" style="background:#008080;display:none;cursor:default"/>
					</td>
				</tr>
			</table>
<div class="butk">
<div class="btn_01">
<a href="#" onclick="doSubmit()">保&nbsp;存</a>
</div>
<div class="btn_01">
<a href="#" onclick="formReset()">清&nbsp;除</a>
</div>
</div>
</div>
</td>
    </tr>
    <tr>
        <td class="main_tab1_td4"><img src="<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_65.gif" alt="left" /></td>
        <td class="main_tab1_td5"></td>
        <td class="main_tab1_td4"><img src="<%=request.getContextPath() %>/jsp/webmanager/images/img_ht_wz_67.gif" alt="right" /></td>
    </tr>
    <tr>
        <td colspan="3" class="main_tab1_td7">&nbsp;</td>
    </tr>
</table>
</s:form>
</body>
</html>